namespace IrisGenerator.Dal {
    using System;
    using System.Collections.Generic;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Data;
    using System.Xml;
    
    
    public partial class Casing : IDisposable {
        
        private DataAccess _dataAccess;
        
        public Casing() {
            this._dataAccess = new DataAccess();
        }
        
        public virtual System.Data.DataSet CASING_Select_All() {
            this._dataAccess.CreateProcedureCommand("sp_CASING_Select_All");
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
        
        public virtual System.Data.DataSet CASING_Select_One(System.Nullable<System.Guid> CAS_ID) {
            this._dataAccess.CreateProcedureCommand("sp_CASING_Select_One");
            this._dataAccess.AddParameter("CAS_ID", CAS_ID, ParameterDirection.Input);
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
        
        public virtual System.Nullable<System.Guid> CASING_Insert(string CAS_NAME, string CAS_DESCRIPTION) {
            this._dataAccess.CreateProcedureCommand("sp_CASING_Insert");
            this._dataAccess.AddParameter("CAS_NAME", CAS_NAME, ParameterDirection.Input);
            this._dataAccess.AddParameter("CAS_DESCRIPTION", CAS_DESCRIPTION, ParameterDirection.Input);
            Guid value = ((Guid)(this._dataAccess.ExecuteScalar()));
            return value;
        }
        
        public virtual System.Nullable<int> CASING_Delete(System.Nullable<System.Guid> CAS_ID) {
            this._dataAccess.CreateProcedureCommand("sp_CASING_Delete");
            this._dataAccess.AddParameter("CAS_ID", CAS_ID, ParameterDirection.Input);
            int value = this._dataAccess.ExecuteNonQuery();
            return value;
        }
        
        public virtual System.Nullable<int> CASING_Update(System.Nullable<System.Guid> CAS_ID, string CAS_NAME, string CAS_DESCRIPTION) {
            this._dataAccess.CreateProcedureCommand("sp_CASING_Update");
            this._dataAccess.AddParameter("CAS_ID", CAS_ID, ParameterDirection.Input);
            this._dataAccess.AddParameter("CAS_NAME", CAS_NAME, ParameterDirection.Input);
            this._dataAccess.AddParameter("CAS_DESCRIPTION", CAS_DESCRIPTION, ParameterDirection.Input);
            int value = this._dataAccess.ExecuteNonQuery();
            return value;
        }
        
        public virtual void Dispose() {
            if ((this._dataAccess != null)) {
                this._dataAccess.Dispose();
            }
        }
    }
}
